// Copyright 2013 Google Inc. All Rights Reserved.auto

#include <errno.h>
#include <irt_syscalls.h>
#include <unistd.h>

int truncate(const char *name, off_t len) {
  if (__nacl_irt_truncate) {
    int result = __nacl_irt_truncate(name, (int64_t) len);
    if (result != 0) {
      errno = result;
      return -1;
    }
    return 0;
  }
  errno = ENOSYS;
  return -1;
}

